<style lang="less" scoped>
.tool-bar {
    margin-bottom: 2em;
}

.h4 {
    margin: 0.8em;
}
</style>
<style lang="less">
.expand-row .ivu-table-body {
    overflow: hidden;
}
</style>

<template>
    <div class="expand-row">
        <div class="tool-bar">
            <Button type="primary" shape="circle" icon="ios-arrow-back" @click="handleRet">返回</Button>
        </div>
        <div class="control box">
            <h4 class="h4 box-cell-1">订单号：{{order_code}}</h4>
           
        </div>
        <Table highlight-row :columns="columns" :data="rows"></Table>
    </div>
</template>
<script>
import expandRow from '@/components/ExpandRow'
export default {
    data() {
        return {
            order_code: "",
            users: [],
            to_user: null,
            columns: [
                {
                    type: 'expand',
                    width: 50,
                    render: (h, params) => {
                        return h(expandRow, {
                            props: {
                                row: params.row,
                                oper:false
                            }
                        })
                    }
                },
                {
                    title: '物资名称',
                    key: 'comdity_name'
                },
                {
                    title: '供应商名称',
                    key: 'supplier_name'
                },
                {
                    title: '单位',
                    key: 'units'
                },
                {
                    title: '购买数量',
                    key: 'buy_number'
                },
                {
                    title: '回填数量',
                    key: 'follow_number'
                },
               

            ],
            rows: [

            ],
            step:2
        }
    },
    computed: {

    },
    created(){
        this.step = this.$route.params["step"]
        this.order_code = this.$route.params["order_code"]
    },
    mounted() {
        this.$store.dispatch('detail', { order_code: this.order_code }).then(resp => {
            this.rows = _.map(resp.data.items,item=>{
                item._expanded=true
                return item
            })
        })

    },
    methods: {
        handleRet() {
            this.$router.go(-1)
        },
       
    }
}
</script>
